/***********************************************************************
    filename:   DaterCalendarMonth.h
    created:    21/4/2012
    author:     4Ys

    purpose:    Defines the month class used in calendar
*************************************************************************/
#ifndef _CalendarMonth_h_
#define _CalendarMonth_h_

#include "DaterCalendarDay.h"
#include "DaterEvent.h"

#include <vector>

namespace Dater
{
	/*!
	\brief
		An entity class contains 28-31 day calendars.
	*/
	class CalendarMonth
	{
	public:
		/*!
		\brief
			Constructor of class CalendarMonth

		\param year
			- an integer means year

		\param month
			- an integer means months

		\param useID
			- an integer means useID.
			- useID points to a disdinct user.
		*/
		CalendarMonth(int year, int month);

		/*!
		\brief
			Destructor for CalendarMonth class
		*/
		~CalendarMonth();

		/*!
		 \brief
			 Return value _year.

		 \return
			 an integer means year.
		*/
		int getYear();

		/*!
		 \brief
			 Return value _month.

		 \return
			 an integer means month.
		*/
		int getMonth();

		/*!
		\brief
			reuturn the number of day in this month
		*/
		int getDayNum();
		
		/*!
		\brief
			Get the CalendarDay of th given day

		\param day
			The day of the Calendar.

		\return
			Pointer to the CalendarDay of the given month
		*/
		CalendarDay* getDayCalendar(int day);

		void addEvent(Event*);

		void deleteEvent(Event*);

	private:
		/*!
		 - an integer of this date means year.
		 - since 1970.
		*/
		unsigned int _year;

		//! an integer of this date means month.
		unsigned int _month;

		//! The list of 28-31 day calendars attach to the month calendar
		std::vector<CalendarDay*> _days;

		//! an integer means the number of days of this month
		unsigned int _dayNum;
	};

}

#endif